home *** CD-ROM | disk | FTP | other *** search
/ Greatest Childrens Stories Ever Told / Greatest_Stories.iso / demos / funtown / demo.dir / 00053_Script_Scripts 10 < prev    next >
Text File  |  1994-11-08  |  5KB  |  121 lines

  1. --òòò Scripts 8
  2. -- òòò development tools
  3. --ùùùùùùùùùùùùùùùùùùùùùùùùùùùùùù
  4. on do2 
  5.   set oldFrame=the frame
  6.   put "  doQuestions ôLearnö  "
  7.   doQuestions "Learn"
  8.   put "  doQuestions ôFindö  "
  9.   set the text of cast "Find Questions"=the text of cast "Learn Questions"
  10.   put "  doQuestions ôMatchö  "
  11.   set the text of cast "Match Questions"=the text of cast "Learn Questions"
  12.   put "  doQuestions ôReadö  "
  13.   doQuestions "Read"
  14.   go frame oldFrame
  15.   put "  returning to frame oldFrame."
  16.   put "  done.  "
  17. end
  18. --ùùùùùùùùùùùùùùùùùùùùùùùùùùùùùù
  19. on doQuestions whichMode 
  20.   global activateScript, allActivateScripts, ML
  21.   set activateScriptX=""
  22.   if voidP ( whichMode ) then
  23.     set whichMode=item ( whichMode ) of "Explore,Learn,Find,Match,Read,TreasureHunt,SuperTreasureHunt,What'sMissing,What'sDifferent,PictureDictionary"
  24.   end if
  25.   repeat with x=0 to ( label ( "end "& whichMode& " Questions" ) - label ( whichMode& " Questions" ) ) 
  26.     go frame ( label ( whichMode& " Questions" ) + x )
  27.     if the type of sprite 2>0 then
  28.       doActivateScript 2
  29.       set activateScriptX=activateScriptX& return& activateScript
  30.     else
  31.       set noPatch=quote& "òNo Patch"& quote& ",0,0,0,0,"& quote& quote& ","& quote& quote& ","& quote& quote 
  32.       set activateScriptX=activateScriptX& return& noPatch
  33.     end if
  34.     if the type of sprite 3>0 then
  35.       doActivateScript 3
  36.       set activateScriptX=activateScriptX& ","& activateScript
  37.       if whichMode="What'sDifferent" then set activateScriptX=activateScriptX& ","& the foreColor of sprite 3
  38.     end if
  39.     if whichMode="Learn" then
  40.       if the type of sprite 4>0 then 
  41.         set activateScriptX=activateScriptX& ","& ( the left of sprite 4 - the left of sprite 3 )
  42.       end if
  43.     end if
  44.     if the type of sprite 5>0 then 
  45.       set activateScriptX=activateScriptX& ","& quote& the name of cast ( the castNum of sprite 5 )& quote
  46.     end if
  47.   end repeat
  48.   set the text of cast ( whichMode& " Questions" )=line 2 to 1000 of activateScriptX
  49. end
  50. --ùùùùùùùùùùùùùùùùùùùùùùùùùùùùùù
  51. on doActivateScript spriteNum
  52.   global activateScript
  53.   if the type of sprite spriteNum=0 then
  54.     set activateScript=""
  55.     exit
  56.   end if
  57.   set theCast=the castNum of sprite spriteNum
  58.   if the name of cast ( theCast )<>"" then
  59.     set theCast2=quote& the name of cast ( theCast )& quote
  60.   else
  61.     set char1=(numToChar(65+(theCast/64)))
  62.     set char2=((theCast mod 64/8)+1)
  63.     set char3=(theCast mod 64 mod 8)
  64.     if integer ( char3 mod 10 = 0 ) then set char3=char3+1
  65.     set theCast2=char1& char2& char3
  66.   end if
  67.   set activateScript=theCast2 & "," & the type of sprite spriteNum & "," & the ink of sprite spriteNum & ","
  68.   if the stretch of sprite spriteNum=0 then set activateScript=activateScript& the locH of sprite spriteNum-the left of sprite 1 & "," & the locV of sprite spriteNum-the top of sprite 1 & "," & quote & quote & "," & quote & quote & "," & quote & quote
  69.   else set activateScript=activateScript& the left of sprite spriteNum & "," & the top of sprite spriteNum & "," & quote &"stretch to:" "e& "," & the right of sprite spriteNum & "," & the bottom of sprite spriteNum
  70.   if the locH of sprite spriteNum>16000 or the locV of sprite spriteNum>16000 then
  71.     put (the right of sprite spriteNum-the left of sprite spriteNum)/2+the left of sprite spriteNum into item 4 of activateScript
  72.     put (the bottom of sprite spriteNum-the top of sprite spriteNum)/2+the top of sprite spriteNum into item 5 of activateScript
  73.     put "Check that the cross-hairs for cast "& item 1 of activateScript &" are centered."
  74.   end if
  75. end
  76. --ùùùùùùùùùùùùùùùùùùùùùùùùùùùùùù
  77. -- òòò Mikey's development Tools on the fly
  78. on doSetCastName firstCast, lastCast
  79.   repeat with x = firstCast to lastCast
  80.     set the name of cast x="!"&the date&&word 1 of the long time&&"Cast "& x
  81.   end repeat
  82. end
  83. --ùùùùùùùùùùùùùùùùùùùùùùùùùùùùùù
  84. on eraseUnusedCast firstCast, lastCast
  85.   repeat with y = 0 to 100
  86.     go frame ( label ( "Learn Questions" ) ) + y
  87.     if the framelabel =  "End Learn Questions"  then 
  88.       put the name of Cast ( the CastNum of Sprite 2 ) into line (y+1 ) of field "TempHold"
  89.       exit repeat
  90.     end if
  91.     put the name of Cast ( the CastNum of Sprite 2 ) into line (y+1 ) of field "TempHold"
  92.   end repeat
  93.   repeat with y = 0 to 100
  94.     go frame ( label ( "Read Questions" ) ) + y
  95.     if the framelabel =  "End Read Questions"  then 
  96.       put the name of Cast ( the CastNum of Sprite 2 ) into line (y+1 ) of field "TempHold2"
  97.       exit repeat
  98.     end if
  99.     put the name of Cast ( the CastNum of Sprite 2 ) into line (y+1 ) of field "TempHold2"
  100.   end repeat
  101.   repeat with x = firstCast to LastCast    
  102.     if field "TempHold" contains the name of Cast x then nothing
  103.     else if field "TempHold2" contains the name of Cast x then nothing
  104.     else erase Cast x
  105.   end repeat
  106. end
  107.  
  108. --ùùùùùùùùùùùùùùùùùùùùùùùùùùùùùù
  109. on setReadName firstCast, lastCast
  110.   
  111.   set y = 10
  112.   repeat with x = firstCast to LastCast
  113.     put the name of Cast x into theName
  114.     set theName =  voidP(theName) 
  115.     set theName  = "ques."& y &"òReadò"
  116.     set y = y + 1
  117.     if theName contains "0" then delete char 7 of theName
  118.     set the Name of Cast x = theName
  119.   end repeat
  120.   
  121. end